





<!DOCTYPE html>
<html lang="en" dir="ltr">

</head>
<body>
    <button id="fire" style="
    position: fixed;
    width: 100%;
    color: red;
    background: yellow;
    height: 50px;
    z-index: 9999;
">RTL</button>
    <hr />
  

  
    <p><strong>This is an <a href="/en-US/docs/MDN/Contribute/Guidelines/Conventions_definitions#Experimental">experimental technology</a></strong><br>Check the <a href="#Browser_compatibility">Browser compatibility table</a> carefully before using this in production.</p>
</div></div>

<p>A <code><strong>Selection</strong></code> object represents the range of text selected by the user or the current position of the caret. To obtain a <code>Selection</code> object for examination or manipulation, call <a href="/en-US/docs/Web/API/Window/getSelection"><code>window.getSelection()</code></a>.</p>

<p>A user may make a selection from left to right (in document order) or right to left (reverse of document order). The <strong><dfn>anchor</dfn></strong> is where the user began the selection and the <strong><dfn>focus</dfn></strong> is where the user ends the selection. If you make a selection with a desktop mouse, the anchor is placed where you pressed the mouse button, and the focus is placed where you released the mouse button.</p>

<div class="blockIndicator note">
<p><em>Anchor</em> and <em>focus</em> should not be confused with the <em>start</em> and <em>end</em> positions of a selection. The anchor can be placed before the focus or vice-versa, depending on the direction you made your selection.</p>
</div>

<h2 id="Properties">Properties</h2>

<dl>
 <dt><a href="/en-US/docs/Web/API/Selection/anchorNode"><code>Selection.anchorNode</code></a><span class="inlineIndicator readOnly readOnlyInline" title="This value may not be changed.">Read only </span></dt>
 <dd>Returns the <a href="/en-US/docs/Web/API/Node"><code>Node</code></a> in which the selection begins. Can return <code>null</code> if selection never existed in the document (e.g., an iframe that was never clicked on).</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/anchorOffset"><code>Selection.anchorOffset</code></a><span class="inlineIndicator readOnly readOnlyInline" title="This value may not be changed.">Read only </span></dt>
 <dd>Returns a number representing the offset of the selection's anchor within the <code>anchorNode</code>. If <code>anchorNode</code> is a text node, this is the number of characters within anchorNode preceding the anchor. If <code>anchorNode</code> is an element, this is the number of child nodes of the <code>anchorNode</code> preceding the anchor.</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/focusNode"><code>Selection.focusNode</code></a><span class="inlineIndicator readOnly readOnlyInline" title="This value may not be changed.">Read only </span></dt>
 <dd>Returns the <a href="/en-US/docs/Web/API/Node"><code>Node</code></a> in which the selection ends. Can return <code>null</code> if selection never existed in the document (for example, in an <code>iframe</code> that was never clicked on).</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/focusOffset"><code>Selection.focusOffset</code></a><span class="inlineIndicator readOnly readOnlyInline" title="This value may not be changed.">Read only </span></dt>
 <dd>Returns a number representing the offset of the selection's anchor within the <code>focusNode</code>. If <code>focusNode</code> is a text node, this is the number of characters within <code>focusNode</code> preceding the focus. If <code>focusNode</code> is an element, this is the number of child nodes of the <code>focusNode</code> preceding the focus.</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/isCollapsed"><code>Selection.isCollapsed</code></a><span class="inlineIndicator readOnly readOnlyInline" title="This value may not be changed.">Read only </span></dt>
 <dd>Returns a Boolean indicating whether the selection's start and end points are at the same position.</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/rangeCount"><code>Selection.rangeCount</code></a><span class="inlineIndicator readOnly readOnlyInline" title="This value may not be changed.">Read only </span></dt>
 <dd>Returns the number of ranges in the selection.</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/type"><code>Selection.type</code></a><span class="inlineIndicator readOnly readOnlyInline" title="This value may not be changed.">Read only </span></dt>
 <dd>Returns a <a href="/en-US/docs/Web/API/DOMString"><code>DOMString</code></a> describing the type of the current selection.</dd>
</dl>

<h2 id="Methods">Methods</h2>

<dl>
 <dt><a href="/en-US/docs/Web/API/Selection/addRange"><code>Selection.addRange()</code></a></dt>
 <dd>A <a href="/en-US/docs/Web/API/Range"><code>Range</code></a> object that will be added to the selection.</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/collapse"><code>Selection.collapse()</code></a></dt>
 <dd>Collapses the current selection to a single point.</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/collapseToEnd"><code>Selection.collapseToEnd()</code></a></dt>
 <dd>Collapses the selection to the end of the last range in the selection.</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/collapseToStart"><code>Selection.collapseToStart()</code></a></dt>
 <dd>Collapses the selection to the start of the first range in the selection.</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/containsNode"><code>Selection.containsNode()</code></a></dt>
 <dd>Indicates if a certain node is part of the selection.</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/deleteFromDocument"><code>Selection.deleteFromDocument()</code></a></dt>
 <dd>Deletes the selection's content from the document.</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/empty"><code>Selection.empty()</code></a></dt>
 <dd>Removes all ranges from the selection. This is an alias for <code>removeAllRanges()</code> — See <a href="/en-US/docs/Web/API/Selection/removeAllRanges"><code>Selection.removeAllRanges()</code></a> for more details.</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/extend"><code>Selection.extend()</code></a></dt>
 <dd>Moves the focus of the selection to a specified point.</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/getRangeAt"><code>Selection.getRangeAt()</code></a></dt>
 <dd>Returns a <a href="/en-US/docs/Web/API/Range"><code>Range</code></a> object representing one of the ranges currently selected.</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/modify"><code>Selection.modify()</code></a><span class="icon-only-inline" title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></dt>
 <dd>Changes the current selection.</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/removeRange"><code>Selection.removeRange()</code></a></dt>
 <dd>Removes a range from the selection.</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/removeAllRanges"><code>Selection.removeAllRanges()</code></a></dt>
 <dd>Removes all ranges from the selection.</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/selectAllChildren"><code>Selection.selectAllChildren()</code></a></dt>
 <dd>Adds all the children of the specified node to the selection.</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/setBaseAndExtent"><code>Selection.setBaseAndExtent()</code></a></dt>
 <dd>Sets the selection to be a range including all or parts of two specified DOM nodes, and any content located between them.</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/setPosition"><code>Selection.setPosition()</code></a></dt>
 <dd>Collapses the current selection to a single point. This is an alias for <code>collapse()</code> — See <a href="/en-US/docs/Web/API/Selection/collapse"><code>Selection.collapse()</code></a> for more details.</dd>
 <dt><a href="/en-US/docs/Web/API/Selection/toString"><code>Selection.toString()</code></a></dt>
 <dd>Returns a string currently being represented by the selection object, i.e. the currently selected text.</dd>
</dl>

<h2 id="Notes">Notes</h2>

<h3 id="String_representation_of_a_selection">String representation of a selection</h3>

<p>Calling the <a href="/en-US/docs/Web/API/Selection/toString"><code>Selection.toString()</code></a> method returns the text contained within the selection, e.g.:</p>

<pre class="brush: js notranslate">var selObj = window.getSelection();
window.alert(selObj); 
</pre>

<p>Note that using a selection object as the argument to <code>window.alert</code> will call the object's <code>toString</code> method.</p>

<h3 id="Multiple_ranges_in_a_selection">Multiple ranges in a selection</h3>

<p>A selection object represents the <a href="/en-US/docs/Web/API/Range"><code>Range</code></a>s that the user has selected. Typically, it holds only one range, accessed as follows:</p>

<div style="overflow: hidden;">
<pre class="brush:js notranslate"><code>var selObj = window.getSelection();
var range  = selObj.getRangeAt(0);</code></pre>
</div>

<ul>
 <li><code><var>selObj</var></code> is a Selection object</li>
 <li><code><var>range</var></code> is a <a href="/en-US/docs/Web/API/Range"><code>Range</code></a> object</li>
</ul>

<p>As the <a class="external" href="http://www.w3.org/TR/selection-api/#h_note_15" rel="noopener">Selection API specification notes</a>, the Selection API was initially created by Netscape and allowed multiple ranges (for instance, to allow the user to select a column from a <a href="/en-US/docs/Web/HTML/Element/table" title="The HTML &lt;table> element represents tabular data — that is, information presented in a two-dimensional table comprised of rows and columns of cells containing data."><code>&lt;table&gt;</code></a>). However, browsers other than Gecko did not implement multiple ranges, and the specification also requires the selection to always have a single range.</p>

<h3 id="Selection_and_input_focus">Selection and input focus</h3>

<p>Selection and input focus (indicated by <a href="/en-US/docs/Web/API/Document/activeElement"><code>Document.activeElement</code></a>) have a complex relationship that varies by browser. In cross-browser compatible code, it's better to handle them separately.</p>

<p>Safari and Chrome (unlike Firefox) currently focus the element containing selection when modifying the selection programmatically; it's possible that this may change in the future (see <a class="external" href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=14383" rel="noopener">W3C bug 14383</a> and <a class="external" href="https://bugs.webkit.org/show_bug.cgi?id=38696" rel="external noopener" title="">WebKit bug 38696</a>).</p>

<h3 id="Behavior_of_Selection_API_in_terms_of_editing_host_focus_changes">Behavior of Selection API in terms of editing host focus changes</h3>

<p>The Selection API has a common behavior (i.e., shared between browsers) that governs how focus behavior changes for <dfn>editing hosts</dfn> after certain methods are called.</p>

<p>The behavior is as follows:</p>

<ol>
 <li>An editing host gains focus if the previous selection was outside of it.</li>
 <li>A Selection API method is called, causing a new selection to be made with the selection range inside the editing host.</li>
 <li>Focus then moves to the editing host.</li>
</ol>

<div class="note">
<p><strong>Note</strong>: The Selection API methods may only move focus to an editing host, not to other focusable elements (e.g., <a href="/en-US/docs/Web/HTML/Element/a" title="The HTML &lt;a> element (or anchor element), with its href attribute, creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a URL can address."><code>&lt;a&gt;</code></a>).</p>
</div>

<p>The above behavior applies to selections made using the following methods:</p>

<ul>
 <li><a href="/en-US/docs/Web/API/Selection/collapse"><code>Selection.collapse()</code></a></li>
 <li><a href="/en-US/docs/Web/API/Selection/collapseToStart"><code>Selection.collapseToStart()</code></a></li>
 <li><a href="/en-US/docs/Web/API/Selection/collapseToEnd"><code>Selection.collapseToEnd()</code></a></li>
 <li><a href="/en-US/docs/Web/API/Selection/extend"><code>Selection.extend()</code></a></li>
 <li><a href="/en-US/docs/Web/API/Selection/selectAllChildren"><code>Selection.selectAllChildren()</code></a></li>
 <li><a href="/en-US/docs/Web/API/Selection/addRange"><code>Selection.addRange()</code></a></li>
 <li><a href="/en-US/docs/Web/API/Selection/setBaseAndExtent"><code>Selection.setBaseAndExtent()</code></a></li>
</ul>

<p>And when the <a href="/en-US/docs/Web/API/Range"><code>Range</code></a> is modified using the following methods:</p>

<ul>
 <li><a href="/en-US/docs/Web/API/Range/setStart"><code>Range.setStart()</code></a></li>
 <li><a href="/en-US/docs/Web/API/Range/setEnd"><code>Range.setEnd()</code></a></li>
 <li><a href="/en-US/docs/Web/API/Range/setStartBefore"><code>Range.setStartBefore()</code></a></li>
 <li><a href="/en-US/docs/Web/API/Range/setStartAfter"><code>Range.setStartAfter()</code></a></li>
 <li><a href="/en-US/docs/Web/API/Range/setEndBefore"><code>Range.setEndBefore()</code></a></li>
 <li><a href="/en-US/docs/Web/API/Range/setEndAfter"><code>Range.setEndAfter()</code></a></li>
 <li><a href="/en-US/docs/Web/API/Range/collapse"><code>Range.collapse()</code></a></li>
 <li><a href="/en-US/docs/Web/API/Range/selectNode"><code>Range.selectNode()</code></a></li>
 <li><a href="/en-US/docs/Web/API/Range/selectNodeContents"><code>Range.selectNodeContents()</code></a></li>
</ul>

<h3 id="Glossary">Glossary</h3>

<p>Other key terms used in this section.</p>

<dl>
 <dt>anchor</dt>
 <dd>The anchor of a selection is the beginning point of the selection. When making a selection with a mouse, the anchor is where in the document the mouse button is initially pressed. As the user changes the selection using the mouse or the keyboard, the anchor does not move.</dd>
 <dt>editing host</dt>
 <dd>An editable element (e.g., an HTML element with <code><a href="/en-US/docs/Web/HTML/Global_attributes#attr-contenteditable">contenteditable</a></code> set, or the HTML child of a document that has <a href="/en-US/docs/Web/API/Document/designMode"><code>designMode</code></a> enabled).</dd>
 <dt>focus of a selection</dt>
 <dd>The <dfn>focus</dfn> of a selection is the end point of the selection. When making a selection with a mouse, the focus is where in the document the mouse button is released. As the user changes the selection using the mouse or the keyboard, the focus is the end of the selection that moves.
 <div class="note">This is not the same as the focused <em>element</em> of the document, as returned by <a href="/en-US/docs/Web/API/Document/activeElement"><code>document.activeElement</code></a>.</div>
 </dd>
 <dt>range</dt>
 <dd>A <dfn>range</dfn> is a contiguous part of a document. A range can contain entire nodes as well as portions of nodes (such as a portion of a text node). A user will normally only select a single range at a time, but it's possible for a user to select multiple ranges (e.g., by using the <kbd>Control</kbd> key). A range can be retrieved from a selection as a <a href="/en-US/docs/Web/API/Range"><code>range</code></a> object. Range objects can also be created via the DOM and programmatically added or removed from a selection.</dd>
</dl>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td><a class="external" href="https://w3c.github.io/selection-api/#selection-interface" hreflang="en" lang="en" rel="noopener">Selection API<br><small lang="en-US">The definition of 'Selection' in that specification.</small></a></td>
   <td><span class="spec-WD">Working Draft</span></td>
   <td>The Selection API specification is based on the HTML Editing APIs specification and focuses on the Selection-related functionality.</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a class="external" href="https://github.com/mdn/browser-compat-data" rel="noopener">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>

<div class="bc-data" id="bcd:api.Selection"><a class="bc-github-link external" href="https://github.com/mdn/browser-compat-data" rel="noopener">Update compatibility data on GitHub</a><table class="bc-table bc-table-web"><thead><tr class="bc-platforms"><td></td><th class="bc-platform-desktop" colspan="6"><span>Desktop</span></th><th class="bc-platform-mobile" colspan="6"><span>Mobile</span></th></tr><tr class="bc-browsers"><td></td><th class="bc-browser-chrome"><span class="bc-head-txt-label bc-head-icon-chrome">Chrome</span></th><th class="bc-browser-edge"><span class="bc-head-txt-label bc-head-icon-edge">Edge</span></th><th class="bc-browser-firefox"><span class="bc-head-txt-label bc-head-icon-firefox">Firefox</span></th><th class="bc-browser-ie"><span class="bc-head-txt-label bc-head-icon-ie">Internet Explorer</span></th><th class="bc-browser-opera"><span class="bc-head-txt-label bc-head-icon-opera">Opera</span></th><th class="bc-browser-safari"><span class="bc-head-txt-label bc-head-icon-safari">Safari</span></th><th class="bc-browser-webview_android"><span class="bc-head-txt-label bc-head-icon-webview_android">Android webview</span></th><th class="bc-browser-chrome_android"><span class="bc-head-txt-label bc-head-icon-chrome_android">Chrome for Android</span></th><th class="bc-browser-firefox_android"><span class="bc-head-txt-label bc-head-icon-firefox_android">Firefox for Android</span></th><th class="bc-browser-opera_android"><span class="bc-head-txt-label bc-head-icon-opera_android">Opera for Android</span></th><th class="bc-browser-safari_ios"><span class="bc-head-txt-label bc-head-icon-safari_ios">Safari on iOS</span></th><th class="bc-browser-samsunginternet_android"><span class="bc-head-txt-label bc-head-icon-samsunginternet_android">Samsung Internet</span></th></tr></thead><tbody><tr><th scope="row"><code>Selection</code> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              1</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox bc-has-history"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              1<div class="bc-icons"><abbr class="only-icon" title="See implementation notes"><span>Notes</span><i class="ic-footnote"></i></abbr> </div><section class="bc-history" id="sect1"><dl><dt class="bc-supports-yes bc-supports"><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              1<div class="bc-icons"><abbr class="only-icon" title="See implementation notes"><span>Notes</span><i class="ic-footnote"></i></abbr> </div></dt><dd><abbr class="only-icon" title="See implementation notes"><span>Notes</span><i class="ic-footnote"></i></abbr> The <a href="https://developer.mozilla.org/docs/Web/API/GlobalEventHandlers/onselectionchange"><code>GlobalEventHandlers.onselectionchange</code></a> and <a href="https://developer.mozilla.org/docs/Web/API/GlobalEventHandlers/onselectstart"><code>GlobalEventHandlers.onselectstart</code></a> event handlers are supported as of Firefox 52.</dd></dl></section></td><td class="bc-supports-yes bc-browser-ie"><span class="bc-browser-name">IE</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              9</td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              9</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              1</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              1</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              18</td><td class="bc-supports-yes bc-browser-firefox_android bc-has-history"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              4<div class="bc-icons"><abbr class="only-icon" title="See implementation notes"><span>Notes</span><i class="ic-footnote"></i></abbr> </div><section class="bc-history" id="sect2"><dl><dt class="bc-supports-yes bc-supports"><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              4<div class="bc-icons"><abbr class="only-icon" title="See implementation notes"><span>Notes</span><i class="ic-footnote"></i></abbr> </div></dt><dd><abbr class="only-icon" title="See implementation notes"><span>Notes</span><i class="ic-footnote"></i></abbr> The <a href="https://developer.mozilla.org/docs/Web/API/GlobalEventHandlers/onselectionchange"><code>GlobalEventHandlers.onselectionchange</code></a> and <a href="https://developer.mozilla.org/docs/Web/API/GlobalEventHandlers/onselectstart"><code>GlobalEventHandlers.onselectstart</code></a> event handlers are supported as of Firefox 52.</dd></dl></section></td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              10.1</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              1</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              1.0</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/addRange"><code>addRange</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              1</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-unknown bc-browser-ie"><span class="bc-browser-name">IE</span><abbr title="Compatibility unknown; please update this.">
                ?
              </abbr></td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/anchorNode"><code>anchorNode</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              1</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-unknown bc-browser-ie"><span class="bc-browser-name">IE</span><abbr title="Compatibility unknown; please update this.">
                ?
              </abbr></td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/anchorOffset"><code>anchorOffset</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              1</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-unknown bc-browser-ie"><span class="bc-browser-name">IE</span><abbr title="Compatibility unknown; please update this.">
                ?
              </abbr></td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/collapse"><code>collapse</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-ie"><span class="bc-browser-name">IE</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              9</td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/collapseToEnd"><code>collapseToEnd</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-unknown bc-browser-ie"><span class="bc-browser-name">IE</span><abbr title="Compatibility unknown; please update this.">
                ?
              </abbr></td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/collapseToStart"><code>collapseToStart</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-unknown bc-browser-ie"><span class="bc-browser-name">IE</span><abbr title="Compatibility unknown; please update this.">
                ?
              </abbr></td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/containsNode"><code>containsNode</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox bc-has-history"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              4<div class="bc-icons"><abbr class="only-icon" title="See implementation notes"><span>Notes</span><i class="ic-footnote"></i></abbr> </div><section class="bc-history" id="sect3"><dl><dt class="bc-supports-yes bc-supports"><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              4<div class="bc-icons"><abbr class="only-icon" title="See implementation notes"><span>Notes</span><i class="ic-footnote"></i></abbr> </div></dt><dd><abbr class="only-icon" title="See implementation notes"><span>Notes</span><i class="ic-footnote"></i></abbr> Before Firefox 35, the method didn't throw if <code>node</code> was <code>null</code>.</dd></dl></section></td><td class="bc-supports-no bc-browser-ie"><span class="bc-browser-name">IE</span><abbr class="bc-level-no only-icon" title="No support">
                <span>No support</span>
              </abbr>
              No</td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android bc-has-history"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              4<div class="bc-icons"><abbr class="only-icon" title="See implementation notes"><span>Notes</span><i class="ic-footnote"></i></abbr> </div><section class="bc-history" id="sect4"><dl><dt class="bc-supports-yes bc-supports"><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              4<div class="bc-icons"><abbr class="only-icon" title="See implementation notes"><span>Notes</span><i class="ic-footnote"></i></abbr> </div></dt><dd><abbr class="only-icon" title="See implementation notes"><span>Notes</span><i class="ic-footnote"></i></abbr> Before Firefox 35, the method didn't throw if <code>node</code> was <code>null</code>.</dd></dl></section></td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/deleteFromDocument"><code>deleteFromDocument</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              55</td><td class="bc-supports-unknown bc-browser-ie"><span class="bc-browser-name">IE</span><abbr title="Compatibility unknown; please update this.">
                ?
              </abbr></td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              55</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/removeAllRanges"><code>empty()</code> as alias of <code>removeAllRanges()</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              55</td><td class="bc-supports-no bc-browser-ie"><span class="bc-browser-name">IE</span><abbr class="bc-level-no only-icon" title="No support">
                <span>No support</span>
              </abbr>
              No</td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              55</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/extend"><code>extend</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-no bc-browser-ie"><span class="bc-browser-name">IE</span><abbr class="bc-level-no only-icon" title="No support">
                <span>No support</span>
              </abbr>
              No</td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-no bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-no only-icon" title="No support">
                <span>No support</span>
              </abbr>
              No</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/focusNode"><code>focusNode</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              3.6</td><td class="bc-supports-yes bc-browser-ie"><span class="bc-browser-name">IE</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              10</td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              5.1</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/focusOffset"><code>focusOffset</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-unknown bc-browser-ie"><span class="bc-browser-name">IE</span><abbr title="Compatibility unknown; please update this.">
                ?
              </abbr></td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/getRangeAt"><code>getRangeAt</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-unknown bc-browser-ie"><span class="bc-browser-name">IE</span><abbr title="Compatibility unknown; please update this.">
                ?
              </abbr></td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/isCollapsed"><code>isCollapsed</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              1</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-unknown bc-browser-ie"><span class="bc-browser-name">IE</span><abbr title="Compatibility unknown; please update this.">
                ?
              </abbr></td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/modify"><code>modify</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr><abbr class="only-icon" title="Non-standard. Expect poor cross-browser support."><span>Non-standard</span><i class="ic-non-standard"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              ≤79</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              4</td><td class="bc-supports-no bc-browser-ie"><span class="bc-browser-name">IE</span><abbr class="bc-level-no only-icon" title="No support">
                <span>No support</span>
              </abbr>
              No</td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              4</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/rangeCount"><code>rangeCount</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-ie"><span class="bc-browser-name">IE</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/removeAllRanges"><code>removeAllRanges</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-ie"><span class="bc-browser-name">IE</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/removeRange"><code>removeRange</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              58</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-unknown bc-browser-ie"><span class="bc-browser-name">IE</span><abbr title="Compatibility unknown; please update this.">
                ?
              </abbr></td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              45</td><td class="bc-supports-no bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-no only-icon" title="No support">
                <span>No support</span>
              </abbr>
              No</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              58</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              58</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              43</td><td class="bc-supports-no bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-no only-icon" title="No support">
                <span>No support</span>
              </abbr>
              No</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              7.0</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/selectAllChildren"><code>selectAllChildren</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-ie"><span class="bc-browser-name">IE</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/setBaseAndExtent"><code>setBaseAndExtent</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              53</td><td class="bc-supports-no bc-browser-ie"><span class="bc-browser-name">IE</span><abbr class="bc-level-no only-icon" title="No support">
                <span>No support</span>
              </abbr>
              No</td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              53</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/collapse"><code>setPosition()</code> as alias of <code>collapse()</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              14</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              55</td><td class="bc-supports-no bc-browser-ie"><span class="bc-browser-name">IE</span><abbr class="bc-level-no only-icon" title="No support">
                <span>No support</span>
              </abbr>
              No</td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              55</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/toString"><code>toString</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              1</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              ≤18</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-unknown bc-browser-ie"><span class="bc-browser-name">IE</span><abbr title="Compatibility unknown; please update this.">
                ?
              </abbr></td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-unknown bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr title="Compatibility unknown; please update this.">
                ?
              </abbr></td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-unknown bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr title="Compatibility unknown; please update this.">
                ?
              </abbr></td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr><tr><th scope="row"><a href="/en-US/docs/Web/API/Selection/type"><code>type</code></a> <div class="bc-icons"><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental</span><i class="ic-experimental"></i></abbr></div></th><td class="bc-supports-yes bc-browser-chrome"><span class="bc-browser-name">Chrome</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-edge"><span class="bc-browser-name">Edge</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              12</td><td class="bc-supports-yes bc-browser-firefox"><span class="bc-browser-name">Firefox</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              57</td><td class="bc-supports-yes bc-browser-ie"><span class="bc-browser-name">IE</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-opera"><span class="bc-browser-name">Opera</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari"><span class="bc-browser-name">Safari</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-webview_android"><span class="bc-browser-name">WebView Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-chrome_android"><span class="bc-browser-name">Chrome Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-firefox_android"><span class="bc-browser-name">Firefox Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              57</td><td class="bc-supports-yes bc-browser-opera_android"><span class="bc-browser-name">Opera Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-safari_ios"><span class="bc-browser-name">Safari iOS</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td><td class="bc-supports-yes bc-browser-samsunginternet_android"><span class="bc-browser-name">Samsung Internet Android</span><abbr class="bc-level-yes only-icon" title="Full support">
                <span>Full support</span>
              </abbr>
              Yes</td></tr></tbody></table><section class="bc-legend" id="sect5"><h3 class="offscreen" id="Legend">Legend</h3><dl><dt><span class="bc-supports-yes bc-supports">
                <abbr class="bc-level bc-level-yes only-icon" title="Full support">
                 <span>Full support</span>
                  
                </abbr></span></dt><dd>Full support</dd><dt><span class="bc-supports-no bc-supports">
                <abbr class="bc-level bc-level-no only-icon" title="No support">
                 <span>No support</span>
                  
                </abbr></span></dt><dd>No support</dd><dt><span class="bc-supports-unknown bc-supports">
                <abbr class="bc-level bc-level-unknown only-icon" title="Compatibility unknown">
                 <span>Compatibility unknown</span>
                  
                </abbr></span></dt><dd>Compatibility unknown</dd><dt><abbr class="only-icon" title="Experimental. Expect behavior to change in the future."><span>Experimental. Expect behavior to change in the future.</span><i class="ic-experimental"></i></abbr></dt><dd>Experimental. Expect behavior to change in the future.</dd><dt><abbr class="only-icon" title="Non-standard. Expect poor cross-browser support."><span>Non-standard. Expect poor cross-browser support.</span><i class="ic-non-standard"></i></abbr></dt><dd>Non-standard. Expect poor cross-browser support.</dd><dt><abbr class="only-icon" title="See implementation notes."><span>See implementation notes.</span><i class="ic-footnote"></i></abbr></dt><dd>See implementation notes.</dd></dl></section></div>

<h3 id="Gecko_notes">Gecko notes</h3>

<ul>
 <li>Gecko/Firefox provide additional features, available to chrome (internal and add-on) code only. These are defined in <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISelectionPrivate" title="">nsISelectionPrivate</a></code>.</li>
 <li>Mozilla source code: <code><a class="external" href="https://dxr.mozilla.org/mozilla-central/source/dom/webidl/Selection.webidl" rel="custom noopener">dom/webidl/Selection.webidl</a></code></li>
 <li><a href="/en-US/docs/Web/API/Selection/selectionLanguageChange"><code>Selection.selectionLanguageChange()</code></a><span class="inlineIndicator obsolete obsoleteInline" title="(Firefox 29 / Thunderbird 29 / SeaMonkey 2.26)">Obsolete since Gecko 29</span> used to be exposed to the web content until Firefox 29</li>
</ul>

<h2 id="See_also">See also</h2>


  
    <div id="auth-modal" class="modal hidden">
    <section class="auth-providers" tabindex="-1" role="dialog" aria-modal="true"
        aria-labelledby="modal-main-heading">
        <header>
            <h2 id="modal-main-heading">Sign In</h2>
        </header>
        
  <p>
    Sign in to enjoy the benefits of an MDN account. If you haven’t already created an account, you will be prompted to do so after signing in.
</p>
<div class="auth-button-container">
    <a href="/users/github/login/?next=%2Fen-US%2Fdocs%2FWeb%2FAPI%2FSelection" class="github-auth" data-first-focusable="true">
        Sign in with Github
    </a>
    <a href="/users/google/login/?next=%2Fen-US%2Fdocs%2FWeb%2FAPI%2FSelection" class="google-auth">
        Sign in with Google
    </a>
</div>

        <button id="close-modal" class="close-modal" data-last-focusable="true">
            <span>Close modal</span>
        </button>
    </section>

<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
<script src="./rtl.js"></script>
<script>
  $('#fire').on('click', applyRTLToSelection);
</script>
</body>
</html>